<?php

class Sgit_Filter_Number implements Zend_Filter_Interface
{
    /**
     * Defined by Zend_Filter_Interface
     *
     * Returns $value
     *
     * @param  string $value
     * @return float
     */
    public function filter($value)
    {
        $value=trim($value);
        
        if(empty($value)){
            if(is_numeric($value)){
                $value=0;
            }else{
                $value=NULL;
            }
        }else{
            $value=str_replace(',','.',$value);
        }
        
        
        return $value;
    }
}
